﻿using System.Text.Json;

namespace LibraryProject.Model;


[SQLite.Table("linkFile")]
public class LinkFile {
    [SQLite.PrimaryKey, SQLite.AutoIncrement, SQLite.Column("id")]
    public int Id { get; set; }

    [SQLite.Column("isDir")]
    public int IsDir { get; set; } = 1;// dictionary or https link

    [SQLite.Column("name")]
    public string Name { get; set; } = "default"; // can be dictionary name or https link content

    [SQLite.Column("parent_id")]
    public int ParentId { get; set; } = 0;

    [SQLite.Ignore]
    public List<LinkFile> ChildrenList { get; set; } = new List<LinkFile>();

    public override string ToString() {
        return JsonSerializer.Serialize(this);
    }
}